package com.cold.demo.sqlite;

import org.sqlite.JDBC;
import org.sqlite.SQLiteDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Test {

    public static void main(String[] args) throws SQLException {
        SQLiteDataSource dataSource = new SQLiteDataSource();

        dataSource.setUrl(JDBC.PREFIX + "/D:/Software/IdeaProjects/demo-project/demo-web-sqlite/src/main/resources/static/Test.db");
        Connection connection = dataSource.getConnection("", "");

        PreparedStatement preparedStatement = connection.prepareStatement("create table user1('id' integer not null ,'name' text,primary key ('id'))");

        int i = preparedStatement.executeUpdate();
        System.out.println(i);

        System.out.println();
    }
}
